package com.yzh.wanandroid.utils.binding

import androidx.databinding.BindingAdapter
import androidx.recyclerview.widget.RecyclerView
import com.yzh.wanandroid.adapter.IntegralListAdapter
import com.yzh.wanandroid.adapter.LoadStateFooterAdapter


@BindingAdapter("integralAdapter")
fun setIntegralAdapter(recyclerView: RecyclerView, adapter: IntegralListAdapter?) {
    adapter?.run {
        recyclerView.adapter = this
        recyclerView.adapter =
            adapter.withLoadStateFooter(footer = LoadStateFooterAdapter(retry = {
                adapter.retry()
            }))
    }
}